package com.ssm.yin.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * @Package: com.ssm.yin.controller
 * @ClassName: TestController
 * @Author: Yin
 * @Date: 18:52
 * @Description: 此文件描述信息
 */
@Controller
@RequestMapping("/test/")
public class TestController {

    @RequestMapping("t1")
    public String test(){ // 测试能否渲染页面
        System.out.println("转发");
        return "redirect:/index.jsp";
    }

    @RequestMapping("t2")
    public String test2(){// 走视图解析器
        System.out.println("转发");
        return "test";
    }

    @RequestMapping("t3")
    @ResponseBody
    public String test3(){// 响应一个数据回去
        System.out.println("响应数据");
        return "hello just a taste.";
    }
}
